package com.youme.section.shop.adapter

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.hyphenate.easeim.R
import com.ziwenl.meituandemo.bean.KehuBean

class DiancankehuAdapter(private val textList: ArrayList<KehuBean>) :
    RecyclerView.Adapter<DiancankehuAdapter.MyViewHolder>() {


    override fun onCreateViewHolder(
        parent: ViewGroup,
        viewType: Int
    ): MyViewHolder {
        val view =
            LayoutInflater.from(parent.context).inflate(R.layout.adapter_diancankehu_item, parent, false)
        return MyViewHolder(view)
    }

    override fun getItemCount(): Int = textList.size ?: 0

    override fun onBindViewHolder(holder: DiancankehuAdapter.MyViewHolder, position: Int) {
        val textpos = textList[position]
        holder.name.text = textpos.name
    }

    class MyViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
        val name: TextView = itemView.findViewById(R.id.kehu_name)
    }
}